package org.blankhole.model;

import java.io.Serializable;

/**
 * ServiceOptions: options for service - config and args
 *
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012/08/15
 * @since 1.0
 */
public class ServiceOptions implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 5297022733601724903L;
	
	/**
	 * id: dao interface
	 */
	private String id;
	/**
	 * args for db
	 */
	private Object args;
	/**
	 * page
	 */
	private Page page;
	/**
	 * the result of db
	 */
	private Object result;
	/**
	 * the options of result
	 */
//	private Object options;
	/**
	 * error code 
	 */
	private int errorCode;
	
	//Constructor
	/**
	 * 构建指定id的DaoOptions对象
	 * 
	 * @param id
	 */
	public ServiceOptions(String id){
		this.id = id;
	}

	//setter and getter
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the args
	 */
	public Object getArgs() {
		return args;
	}

	/**
	 * @param args the args to set
	 */
	public void setArgs(Object args) {
		this.args = args;
	}

	/**
	 * @return the page
	 */
	public Page getPage() {
		return page;
	}

	/**
	 * @param page the page to set
	 */
	public void setPage(Page page) {
		this.page = page;
	}

	/**
	 * @return the result
	 */
	public <T> T getResult() {
		return (T)result;
	}

	/**
	 * @param result the result to set
	 */
	public void setResult(Object result) {
		this.result = result;
	}

	/**
	 * @return the errorCode
	 */
	public int getErrorCode() {
		return errorCode;
	}

	/**
	 * @param errorCode the errorCode to set
	 */
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	//toString
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ArgsOptions [id=" + id + ", args=" + args + ", page=" + page
				+ ", result=" + result + "]";
	}
	
}
